/*
 * @Description: 上传相关接口
 * @Author: Rfan
 * @Date: 2022-05-13 15:46:02
 * @LastEditTime: 2022-06-24 17:47:54
 */

import { minioRequest } from '@/utils/request';

export const uploadPath = `${minioRequest.defaults.baseURL}/upload`;
export const uploadsPath = `${minioRequest.defaults.baseURL}/uploads`;

export interface IUploadResourceResponse {
  name: string;
  ext: string;
  path: string;
  size: number;
  url: string;
}
// 上传文件-批量
export function uploadResource(data: any, config?: any) {
  return minioRequest({
    url: `/uploads`,
    method: 'post',
    data,
    ...config
  });
}

// 上传文件-单个
export function uploadSingle(data: any) {
  return minioRequest({
    url: `/upload`,
    method: 'post',
    data
  });
}
